package sctu.edu.java.year2016.team07.nieying.practice.dishizhang;

import java.util.*;

/**
 * Created by Administrator on 2016/6/1 0001.
 */
public class Demo1 {
    public static void main(String args[]){
        List<String> list=new ArrayList<>();
        list.add("apple");
        list.add("pear");
        list.add("banana");
        list.add("apple");
        Set<String> set=new HashSet<>();
        set.addAll(list);
        Iterator<String> it=set.iterator();
        System.out.println("集合中的元素是: \n");
        while(it.hasNext()){
            System.out.println(it.next()+"\t");

        }
    }
}
